<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>be5-app</artifactId>
    <groupId>com.developmentontheedge.be5</groupId>
    <version>1.0.0-SNAPSHOT</version>
  </parent>

  <groupId>${groupId}</groupId>
  <artifactId>${artifactId}</artifactId>
  <version>${version}</version>
  <packaging>${packaging.type}</packaging>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <deployPath>/${artifactId}</deployPath>
  </properties>

  <dependencies>
    <!-- Your target database -->
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>42.3.8</version>
    </dependency>

    <!-- For tests -->
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>[2.1.210,)</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>[4.12,)</version>
      <scope>test</scope>
    </dependency>	

    <!-- Sample dependency on BE5 module -->
    <dependency>
      <groupId>com.developmentontheedge.be5</groupId>
      <artifactId>be5-monitoring</artifactId>
      <version>0.0.3-SNAPSHOT</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.developmentontheedge.be5</groupId>
        <artifactId>be5-maven-plugin</artifactId>
        <version>0.1.1-SNAPSHOT</version>
        <configuration>
          <projectPath>./</projectPath>
        </configuration>
        <executions>
            <execution>
                <id>generate-context</id>
                <phase>prepare-package</phase>
                <goals>
                    <goal>generate-context</goal>
                </goals>
                <configuration>
                    <generateContextPath>${project.build.directory}/${project.artifactId}/META-INF</generateContextPath>
                </configuration>
            </execution>
            <execution>
                <id>generate-groovy-dsl</id>
                <phase>prepare-package</phase>
                <goals>
                    <goal>generate-groovy-dsl</goal>
                </goals>
                <configuration>
                    <fileName>${project.build.directory}/generated-sources/java/${project.artifactId}</fileName>
                </configuration>
            </execution>
        </executions>
        <!-- duplicate for (ModuleLoader2.class).getClassLoader().getResources(PROJECT_FILE_NAME); -->
        <dependencies>
            <dependency>
                <groupId>com.developmentontheedge.be5.modules</groupId>
                <artifactId>be5-modules-core</artifactId>
                <version>0.1.1-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>[2.1.210,)</version>
            </dependency>
            <!-- Your target database -->
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>42.3.8</version>
            </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

</project>
